<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const a = { a: 1 };
      const b = { b: 1 };
      const obj = {};
      const arr = [];
      // obj.__proto__ = a
      // arr.__proto__ = b
      Object.setPrototypeOf(obj, a);
      Object.setPrototypeOf(arr, b);
      // 标准
      console.log(Object.getPrototypeOf(obj));
      console.log(Object.getPrototypeOf(arr));
      // console.log(obj.__proto__);
      // console.log(arr.__proto__);
    </script>
  </body>
</html>
